<?php 
namespace Admin\Event;
use \Think\Controller;

class UserEvent extends Controller
{
    public function index()
    {
        return '我是临时工...';
    }

    public function upload()
    {
    	$upload=new \Think\Upload();
    	$upload->max->Size=3145678;
    	$upload->exts->array('jpg','gif','png','jpeg');
    	$upload->rootPath='/Uploads/';
    	$upload->savePath='';
    	$upload->saveName=array('date','Y-m-d');
    	$upload->autoSub = true;
        $upload->subName = array('date','Ymd');
    	$info=$upload->upload();
    	if (!$info) {
    		$this->error($upload->getError());
    	} else {
    		// $this->success('上传成功');
    		foreach($info as $file){
    			echo $file['savepath'].$file['savename'];
    		}
    	}

    	$image=new \Think\Image();
    	$image->open('savepath'.'savename');
    }
}

